package com.life.muyu.utils;

import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @Author zyb
 * @Date 2/17/2020 6:48 PM
 **/
public class ImageUtils {
    public static  boolean hasNotImg(MultipartFile file){
        return !(file.getOriginalFilename().endsWith(".png")||file.getOriginalFilename().endsWith(".jpg"));
    }
    public static boolean hasNotImg(List<MultipartFile> files){
        for (MultipartFile file : files) {
            if (!(file.getOriginalFilename().endsWith(".png")||file.getOriginalFilename().endsWith(".jpg"))){
                return  true;
            }
        }
        return false;
    }
}
